package org.example.auth.model.entity;

import lombok.Getter;
import lombok.Setter;
import org.example.misc.model.CommonEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "auth_user")
@org.hibernate.annotations.Table(appliesTo = "auth_user", comment = "用户表")
@Getter
@Setter
public class User implements Serializable {
    private static final long serialVersionUID = -5648954235867074158L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(nullable = false)
    private Long id;

    @Column(nullable = false, unique = true)
    private String code;

    @Column(nullable = false)
    private String realName;

    @Column(nullable = false)
    private String nickName;

    @Column(nullable = false, unique = true)
    private String loginName;

    @Column(nullable = false)
    private String password;

    @Embedded
    private CommonEntity commonInfo;
}
